package cn.gzmli.dtt.common.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.StringHttpMessageConverter;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

import java.nio.charset.Charset;
import java.util.List;

/**
 * Created by songcai.jiang  on 2019/7/25.
 */

public class MyWebAppConfigurer extends WebMvcConfigurationSupport {

    @Override
    protected void configureMessageConverters(List converters)
    {
         super.configureMessageConverters(converters);
         converters.add(responseBodyConverter());
    }

    @Bean
    public HttpMessageConverter responseBodyConverter()
    {
        StringHttpMessageConverter converter = new StringHttpMessageConverter(Charset.forName("UTF-8"));
        return converter;
    }



}
